package com.gasolinator.a.util;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.Toast;
import com.gasolinator.a.R;

/**
 * Created by IntelliJ IDEA.
 * User: fjhidalgo
 * Date: 30/11/11
 * Time: 12:17
 * To change this template use File | Settings | File Templates.
 */
public class PromptUtils {


    public static void showToast(Context context) {
        showToastBase(context, context.getResources().getString(R.string.error_location));
    }

    public static void showToastBase(Context context, CharSequence msg) {
        Toast localToast = Toast.makeText(context, msg, 1);
        localToast.setGravity(17, 0, 0);
        localToast.show();
    }

    public static void alertErrorData(Context context) {
        DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener(){

            public void onClick(DialogInterface dialogInterface, int i) {
                //To change body of implemented methods use File | Settings | File Templates.
            }
        };

        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setCancelable(false);

        builder.setPositiveButton(R.string.dialog_ok, listener);
        builder.setTitle(R.string.error);
        builder.setMessage(R.string.error_data);
        builder.create().show();
    }
}
